<div class="view-header">
    <div class="view-header-left">
        <div class="view-header-item color-open" ng-click="ranks_add = true" title="添加岗位" ng-show="!ranks_add && !edit_open">
            <i class="fa fa-plus"></i> 添加岗位
        </div>
        <!-- add -->
        <div class="view-header-item color-close above-cover no-widen" ng-click="ranks_add = false" ng-show="ranks_add" title="关闭">
            <i class="fa fa-close"></i>
        </div>
        <div class="view-header-item color-check above-cover" ng-click="add();ranks_add = false" ng-show="ranks_add" title="提交">
            <i class="fa fa-check"></i> 确认提交
        </div>
        <!-- edit -->
        <div class="view-header-item color-close above-cover no-wwiden" ng-click="edit_open = false" ng-show="edit_open" title="关闭">
            <i class="fa fa-close"></i>
        </div>
        <div class="view-header-item color-check above-cover" ng-click="upd();edit_open = false" ng-show="edit_open" title="提交">
            <i class="fa fa-check"></i> 确认修改
        </div>
    </div>
</div>
<div class="view-content">
    <div class="view-left ranks-left">
        <div class="view-left-search">
            <input type="text" placeholder='Search' ng-model="user_name_filter">
            <i class="fa fa-search"></i>
        </div>
        <div class="view-left-block">
            <div class="view-left-item"
                 ng-repeat="item in ranks|orderBy:['name'] | filter:ranks_filter"
                 ng-click='ranks_role_show(item,ranks)'
                 ng-class="{true: 'marked', false: ''}[item.iscolor]">
                <li>
                    <i class="fa fa-user"></i>
                </li>
                <li class="view-left-item-user">
                    {{item.name}}--{{item.remark}}
                </li>
                <li class="view-left-item-del">
                    <i class="fa fa-trash" ng-click="del(item);$event.stopPropagation()"></i>
                </li>
                <li class="view-left-item-del">
                    <i class="fa fa-edit" ng-click="edit(item);$event.stopPropagation()"></i>
                </li>
            </div>
        </div>
    </div>
    <!-- 权限分配 -->
    <div class="privilege-right ranks-right" ng-show="ranks_role_cover">
        <div class="privilege-right-content ranks-right-content">
            <div class="view-left-search privilege-und-bg">
                <input type="text" placeholder='未分配权限' ng-model="search_role">
            </div>
            <div class="privilege-right-block">
                <div class="privilege-right-item" ng-repeat="item in cur_rank_unassigned_roles |orderBy:['rolename'] |filter:search_role" ng-click="add_role(item)">
                    <li class="privilege-right-name">{{item.rolename}}</li>
                    <li class="privilege-right-plus">
                        <i class="fa fa-plus"></i>
                    </li>
                </div>
            </div>
        </div>
        <div class="privilege-right-content ranks-right-content">
            <div class="view-left-search privilege-und-bg">
                <input type="text" placeholder='已有权限' ng-model="search_role">
            </div>
            <div class="privilege-right-block">
                <div class="privilege-right-item" ng-repeat="item in cur_rank_assigned_roles |orderBy:['rolename'] |filter:search_role" ng-click="del_role(item)">
                    <li class="privilege-right-name">{{item.rolename}}</li>
                    <li class="privilege-right-plus">
                        <i class="fa fa-minus"></i>
                    </li>
                </div>
            </div>
        </div>

    </div>
</div>

<!-- add -->
<div class="data-overlay" ng-show='ranks_add'>
    <div class="overlay-container">
        <div class="overlay-header">添加岗位</div>
        <div ng-form name="form_add" novalidate="novalidate">
            <div class="overlay-content">
                <div class="overlay-column overlay-column-4">
                    <div class="overlay-item">
                        <span class="overlay-name">岗位</span>
                        <input type="text" ng-model="new_rank.name">
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">类型</span>
                        <select ng-model="new_rank.type">
                            <option value="0"> 普通</option>
                            <option value="9"> 管理</option>
                        </select>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">描述</span>
                        <textarea ng-model="new_rank.remark"></textarea>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<!-- edit -->
<div class="data-overlay" ng-show="edit_open">
    <div class="overlay-container">
        <div class="overlay-header">岗位信息修改</div>
        <div ng-form name="edit_form" novalidate="novalidate">
            <div class="overlay-content">
                <div class="overlay-column overlay-column-4">
                    <div class="overlay-item">
                        <span class="overlay-name">岗位名称</span>
                        <input type="text" ng-model="cur_rank.name">
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">类型</span>
                        <select ng-model="cur_rank.type">
                            <option value="0"> 普通</option>
                            <option value="9"> 管理</option>
                        </select>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">类型</span>
                        <textarea ng-model="cur_rank.remark"></textarea>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>